-
Notifications
You must be signed in to change notification settings - Fork 4
Parse value expressions printed on separate lines #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
56acdc4
to
e7847a1
Compare
// the exprs to the state of the _previous_ instruction | ||
const prevIdx = siblingInsLine(lines, idx, -1); | ||
const prevLine = <InstructionLine>lines[prevIdx]; | ||
if (prevIdx < idx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it'll only trigger for idx=0
.
src/analyzer.ts
Outdated
@@ -293,6 +296,20 @@ function updateGlobalFuncCall(callLine: ParsedLine, info: GlobalFuncValidInfo) { | |||
ins.writes = ["r0", ...BPF_SCRATCH_REGS]; | |||
} | |||
|
|||
function updateBpfStateExprs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming nit - maybe updatePrevInsBpfState
Verifier in some cases may print information about known values separately from the relevant instruciton, for example: 100: (85) call bpf_ringbuf_reserve#131 101: frame1: R0=ringbuf_mem_or_null(id=5,ref_obj_id=5,sz=196) refs=5 101: (bf) r7 = r0 ; frame1: R0=ringbuf_mem_or_null(id=5,ref_obj_id=5,sz=196) R7_w=ringbuf_mem_or_null(id=5,ref_obj_id=5,sz=196) refs=5 Note that second line contains state produced by instrcution at 100. Implement parsing these messages and incorporating the information from them in the computed array of BpfState objects.
e7847a1
to
79078af
Compare
Verifier in some cases may print information about known values
separately from the relevant instruciton, for example:
Note that second line contains state produced by instrcution at 100.
Implement parsing these messages and incorporating the information
from them in the computed array of BpfState objects.